var express = require('express');
const pool = require('../pool');
var router = express.Router();

/* GET home page. */
//http:127.0.0.1:3000/index
router.get('/index', function(req, res, next) {
  let id=req.query.id
  //req
 // res.send("123456");
 pool.query('select * from xh where id=?',[id],(err,result)=>{
   if(err){next(err);return;}
   if(result.length>0){
     res.send(result)
   }else{
     res.send('终是身上无分文、辜负小巷俏佳人')
   }
 })
});  

module.exports = router;
